-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core
] Fix peft multi-gpu issue
#145
Conversation
Installed this and it works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @younesbelkada, thanks a lot for this PR to enable tuning using naive pipeline parallelism across multi-gpu setup. Left a few nits.
src/peft/tuners/lora.py
Outdated
return F.linear(x, transpose(self.weight, self.fan_in_fan_out), bias=self.bias) | ||
elif self.r > 0 and not self.merged: | ||
result = F.linear(x, transpose(self.weight, self.fan_in_fan_out), bias=self.bias) | ||
if self.r > 0: | ||
result += self.lora_B(self.lora_A(self.lora_dropout(x))) * self.scaling | ||
result = result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed I think
src/peft/tuners/lora.py
Outdated
@@ -339,17 +344,20 @@ def eval(self): | |||
self.lora_B.eval() | |||
|
|||
def forward(self, x: torch.Tensor): | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed I think
Thanks a lot for your review! Fixed the comments! Merging |
What does this PR do?
This PR fixes
peft
+ LoRA multi-gpu issue, to reproduce, run:cc @pacman100